package com.geekhalo.domainevent.v3.async;

import com.geekhalo.domainevent.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class AsyncCartListener {
    @Autowired
    private CartService cartService;


    @EventListener
    @Async
    public void cleanCart(OrderCreatedEvent event) {
        CleanCartCommand cleanCartCommand = buildCleanCartCommand...
        this.cartService.clean(cleanCartCommand);
    }
}
